public class TestIsSorted {
    public static void main(String[] args) {
        double[] a1 = {16.1, 25.3, 12.2, 44.4};
        double[] a2 = {1.5, 4.3, 7.0, 19.5, 25.1, 46.2};
        double[] a3 = {42.0};
        System.out.println(isSorted(a1));  // false
        System.out.println(isSorted(a2));  // true
        System.out.println(isSorted(a3));  // true
    }

    public static boolean isSorted(double[] list) {
        boolean result = false;
        if (list.length == 1) {
            return true;
        }
        for (int i = 0; i < list.length - 1; i++) {
            if (list[i] > list[i + 1]) {
                result = false;
                break;
            }
            else if (list[i] < list[i + 1]) {
                result = true;
            }
        }
        return result;
    }
}